package com.xbongbong.pro.statistic.service;

import com.xbongbong.paas.pojo.dto.PaasFormDataEsInitDTO;
import com.xbongbong.paas.pojo.vo.PaasFormDataEsInitVO;
import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.pro.statistic.pojo.dto.ChartEditDTO;
import com.xbongbong.pro.statistic.pojo.dto.InitAllDTO;
import com.xbongbong.pro.statistic.pojo.dto.LogStashEditDTO;
import com.xbongbong.pro.statistic.pojo.dto.MappingInitDTO;
import com.xbongbong.pro.statistic.pojo.dto.ReInitDataDTO;
import com.xbongbong.pro.statistic.pojo.dto.UpdateDataDTO;
import com.xbongbong.pro.statistic.pojo.vo.DataInitVO;

import java.io.IOException;

/**
 * @author 梁鲁江
 * @date 2019/2/12 14:04
 * @version v1.0
 * @since v1.0
 */
public interface DataWarehouseService {
    /**
     * 初始化仓库
     * @param chartEditDTO
     * @return
     * @throws XbbException
     */
    DataInitVO  initData(ChartEditDTO chartEditDTO) throws XbbException;
    /**
     * 重建BI数据
     * @param reInitDataDTO
     * @return
     * @throws XbbException
     */
    DataInitVO  reInitBIData(ReInitDataDTO reInitDataDTO) throws XbbException;

    DataInitVO  reInitAllBIData(ReInitDataDTO reInitDataDTO) throws XbbException;
    
    DataInitVO  reInitCustomerBIData(MappingInitDTO mappingInitDTO) throws XbbException;

    /**
     * 初始化所有的mapping
     * @param mappingInitDTO
     * @return
     * @throws XbbException
     */
    DataInitVO initAllBiMapping(MappingInitDTO mappingInitDTO) throws XbbException;
    /**
     * 初始化单个BI业务mapping
     * @param mappingInitDTO
     * @return
     * @throws XbbException
     */
    DataInitVO  initNewBiMapping(MappingInitDTO mappingInitDTO) throws XbbException;
    /**
     * 按照仓库更新数据
     * @param updateDataDTO
     * @return
     * @throws XbbException
     */
    DataInitVO  updateBIData(UpdateDataDTO updateDataDTO) throws XbbException;

    /**
     * 删除所有的数据
     * @param mappingInitDTO
     * @return
     * @throws XbbException
     */
    @Deprecated
    DataInitVO  deleteAllData(MappingInitDTO mappingInitDTO) throws XbbException;

    /**
     * 初始化logStash配置文件
     * @param logStashEditDTO 主要信息
     * @return DataInitVO
     * @throws XbbException error
     */
    DataInitVO  initLogStash(LogStashEditDTO logStashEditDTO) throws XbbException;

    /**
     * 重建所有的多表数据（需要先执行deleteAllData删掉数据）
     * @param initAllDTO
     * @return
     * @throws XbbException
     */
    DataInitVO  initAllData(InitAllDTO initAllDTO) throws XbbException;
    @Deprecated
    PaasFormDataEsInitVO init(PaasFormDataEsInitDTO paasFormDataEsInitDTO) throws XbbException;
    @Deprecated
    PaasFormDataEsInitVO initAll(PaasFormDataEsInitDTO paasFormDataEsInitDTO) throws XbbException;

    DataInitVO updateBIDataByChartId(ReInitDataDTO reInitDataDTO) throws XbbException;

    public void deleteQueryByWareHouseId(Long warehouseId, String index) throws IOException, XbbException;
}
